package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by fuyi on 2017/10/20.
 */

public class FeedBackApi extends BaseApi {
    FeedBackReq req;
    public FeedBackApi(String member_id, String client_type, String opinion){
        req=new FeedBackReq(member_id,client_type,opinion);
    }
    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getFeedBack(requestBody);
    }

    private class FeedBackReq{
        private String member_id;
        private String client_type;
        private String opinion;

        public FeedBackReq(String member_id, String client_type, String opinion) {
            super();
            this.member_id = member_id;
            this.client_type = client_type;
            this.opinion = opinion;
        }


    }
}
